import { createRouter, createWebHashHistory } from "vue-router";
//定义路由表
const routes = [
    /* 
    {
        path:'/',
        name: 'xxx',
        commponent: () => import('xxxx'),
    },
    */
    {
        path: '/',
        name: 'start',
        component: () => import("../components/start.vue"),
    },

    {
        //默认为登录界面
        path: '/adminLogIn',
        name: 'adminLogIn',
        component: () => import('../components/admin/adminLogIn.vue'),
    },
    {
        path: '/adminMain',
        name: 'adminMain',
        component: () => import('../components/admin/mainPageComponent/adminMain.vue'),
        children: [
            {
                path: '/admin/eventApplication',
                name: 'eventApplication',
                component: () => import('../components/admin/activityMange/eventApplication.vue'),
            },
            {
                path: '/admin/log',
                name: 'log',
                component: () => import('../components/admin/log/log.vue'),
            },
            {
                path: '/admin/stuMangement',
                name: 'stuMangement',
                component: () => import('../components/admin/studentMangment/stuMangement.vue'),
            },
            {
                path: '/admin/stuOrgAccountRes',
                name: 'stuOrgAccountRes',
                component: () => import('../components/admin/stuOrganMangment/stuOrgAccountMang.vue'),
            },
            {
                path: '/admin/adminRes',
                name: 'adminRes',
                component: () => import('../components/admin/others/adminMang.vue'),
            },
            {
                path: '/admin/customSettings',
                name: 'customSettings',
                component: () => import('../components/admin/customSettings/customSettings.vue'),
            },
            {
                path: '/admin/supplementation',
                name: 'supplementation',
                component: () => import('../components/admin/others/supplementation.vue')
            },
            {
                path: '/admin/announcementMange',
                name: 'announcementMange',
                component: () => import('../components/admin/announcement/announcementMange.vue')
            },
            {
                path:'/admin/commentMang',
                name:'commentMang',
                component:()=>import('../components/admin/activityMange/commentMang.vue')
            }
        ]
    },
    ///////////////////////////////////////////////////////////////////////////////////////////////
    {
        path: "/soLogin",
        name: 'soLogin',
        component: () => import("../components/so/Login.vue"),
    },
    {
        path: '/somain',
        name: 'somain',
        component: () => import('../components/so/soMain.vue'), // 懒加载组件
        children: [
            {
                path: '',
                component: () => import('../views/default.vue'), // 默认子路由
            },
            {
                path: '/organization-file', // 组织档案袋页面
                component: () => import('../views/OrganizationFile.vue'), // 组织档案袋页面
            },
            {
                path: '/activitycreate', // 默认子路由
                component: () => import('../views/activitycreate.vue'), // 活动创建页面
            },
            {
                path: '/change-password',
                component: () => import('../views/ChangePassword.vue'), // 修改密码页面
            },
            {
                path: '/edit-profile',
                component: () => import('../views/EditProfile.vue'), // 修改个人信息页面
            },
            {
                path: '/set-student-cadre',
                component: () => import('../views/SetStudentCadre.vue'), // 设置学生干部页面
            },
            {
                path: '/release-notice',
                component: () => import('../views/ReleaseNotice.vue'), // 发布公告页面
            },
            {
                path: '/notice-list',
                component: () => import('../views/noticelist.vue'), // 公告列表页面
            },
            {
                path: '/activitylist',
                component: () => import('../views/ActivityList.vue'), // 活动列表页面
            },
            {
                path: '/activity/edit/:actId',
                name: 'ActivityEdit',
                component: () => import('../views/ActivityEdit.vue')
            },
            {
                path: '/changesturole',
                component: () => import('../views/changesturole.vue'), // 修改学生角色页面
            },
            {
                path: '/deletestu',
                component: () => import('../views/deletestu.vue'), // 删除学生页面
            },
            {
                path: '/release-news',
                component: () => import('../views/releasenews.vue'), // 发布新闻稿页面
            },
            {
                path: '/news-list',
                component: () => import('../views/newslist.vue'), // 新闻稿列表页面
            },
            {
                path: '/searchstuorg',
                component: () => import('../views/searchstuorg.vue'), // 搜索学生组织页面
            },
            {
                path: '/searchadmin',
                component: () => import('../views/searchadmin.vue'), // 搜索管理员页面
            },
            {
                path: '/notice/:id',
                name: 'NoticeDetail',
                component: () => import('../views/noticedetail.vue')
            },
            {
                path: '/searchadminnotice',
                component: () => import('../views/searchadminnotice.vue'), // 搜索管理员公告页面
            },
            {
                path: '/announcement/:id',
                name: 'AnnouncementDetail',
                component: () => import('../views/announcementdetail.vue')
            },
        ],
    },
    {
        path: '/stuLogin',
        name: 'stuLogin',
        component: () => import('../components/student/login.vue'),
    },
    {
        path: '/stuMain',
        name: 'stuMain',
        component: () => import('../components/student/studentmain.vue'),
        children: [
            {
                path: '',
                component: () => import('../stuview/default.vue'), // 默认子路由
            },
            {
                path: '/stu/changepassword',
                component: () => import('../stuview/changepassword.vue'), // 修改密码页面
            },
            {
                path: '/stu/editpersonalinfo',
                component: () => import('../stuview/editpersonalinfo.vue'), // 修改个人信息页面
            },
            {
                path: '/stu/searchactivity',
                component: () => import('../stuview/searchactivitylist.vue'), // 搜索活动页面
            },
            {
                path: '/stu/activity/:actId',
                name: 'ActivityDetail',
                component: () => import('../stuview/activitydetails.vue')
            },
            {
                path: '/stu/actmem',
                component: () => import('../stuview/activitymemory.vue'), // 活动记录页面
            },
            {
                path: '/stu/searchstuorg',
                component: () => import('../stuview/searchstuorglist.vue'), // 搜索学生组织页面
            },
            {
                path: '/stu/stuorg/:orgId',
                name: 'StuOrgDetail',
                component: () => import('../stuview/stuorgdetails.vue') // 学生组织详情页面
            },
            {
                path: '/stu/myorg',
                component: () => import('../stuview/myorg.vue'), // 我的组织页面
            },
            {
                path: '/stu/myattendorgs',
                component: () => import('../stuview/myattendorgs.vue'), // 我参加的组织页面
            },
            {
                path: '/stu/searchorgnotice',
                component: () => import('../stuview/searchorgnotice.vue'), // 搜索组织公告页面
            },
            {
                path: '/stu/searchorgnews',
                component: () => import('../stuview/searchorgnews.vue'), // 搜索组织新闻稿页面
            },
            {
                path: '/stu/searchadminnotice',
                component: () => import('../stuview/searchadminnotice.vue'), // 搜索管理员公告页面
            },
            {
                path: '/stu/notice/:id',
                name: 'StuNoticeDetail',
                component: () => import('../stuview/noticedetails.vue'),
            },
            {
                path: '/stu/announcement/:id',
                name: 'StuAnnouncementDetail',
                component: () => import('../stuview/Announcementdetail.vue')
            },
            {
                path: '/stu/searchstuorg',
                component: () => import('../stuview/searchstuorg.vue'), // 搜索组织页面
            },
            {
                path: '/stu/searchadmin',
                component: () => import('../stuview/searchadmin.vue'), // 搜索管理员页面
            }
        ]
    }
];

//创建路由实例
const router = createRouter({
    history: createWebHashHistory(),
    routes,
})
export default router;